package com.sanbi.erp.core.config;

import com.github.houbb.property.support.converter.IFieldValueContext;
import com.github.houbb.property.support.converter.IPropertyValueContext;
import com.github.houbb.property.support.converter.IValueConverter;

import java.math.BigDecimal;

/**
 * @Desc: 属性上下文数值类型转换器
 * @Data: 2022/8/24 14:49
 * @Author: WuHang
 */
public class BigDecimalValueConverter implements IValueConverter {
    @Override
    public Object fieldValue(String value, IFieldValueContext context) {
        return new BigDecimal(value);
    }

    @Override
    public String propertyValue(Object value, IPropertyValueContext context) {
        return String.valueOf(value);
    }
}
